package com.nblog.controller.admin;

import java.util.LinkedHashMap;
import com.jfinal.core.Controller;
import com.nblog.utils.CommonUtils;

public class BaseControlller extends Controller {
	protected String test() {
		return "test";
	}
	protected LinkedHashMap<String,String> getOrderby(){
		String sord=this.getPara("order");
		String sidx=this.getPara("sort");
		LinkedHashMap<String,String> orderby=new LinkedHashMap<String,String>();
		if(CommonUtils.isNotEmpty(sidx)){
			orderby.put(sidx, sord);
		}
		return orderby;
	}
	/**
	 * 获取排序字符串
	 * @author eason	
	 * @return
	 */
	protected String getOrderbyStr(){
		String sord=this.getPara("order");
		String sidx=this.getPara("sort");
		if(CommonUtils.isNotEmpty(sidx)){
			return " order by "+ sidx+" "+sord;
		}
		return "";
	}
}
